//app.js
const _url = "https://www.oreorigin.com/router/wechat";
App({
  onLaunch: function () {
    wx.setBackgroundFetchToken({
      token: 'xxx'
    })
  },
  globalData: {
    userInfo: null
  },
  _normal(path,method,data,success,fail){
    wx.request({
      url: _url+path,
      method,
      data,
      success(e){
       return success(e.data)
      },
      fail
    })
  },
  get(path,data,success,fail){
    this._normal(path,"GET",data,success,fail)
  },
  post(path,data,success,fail){
    this._normal(path,"POST",data,success,fail)
  },
  towxml:require('/towxml/index'),
  util:require("/utils/util")
})